Apparatus for operating a motor driven device and testing state of series limit switch over same two-wire circuit

ABSTRACT

Apparatus for operating a motor driven device and testing the state of a limit switch in series with the motor, in the environment of a field interface device in a tank farm is disclosed. During operation of a relatively high power relay (115), a latched (145) signal ties one side (130) of the two-wire circuit to ground through a low impedance (139). When testing of the state of a series limit switch (119) is needed, the same supply voltage is switched onto one side of the two-wire circuit (147) but the low side of the two-wire circuit is grounded through a relatively high impedance (135, 136) to prevent sufficient current for operating the relay coil (117) from flowing. The presence or absence of current through the high impedance is detected through a coupling device (137) which provides a logical one or zero on an output line (68) to determine whether the limit switch is open or closed.

This application is a division, of application Ser. No. 200,382, filedOct. 24, 1980.

TECHNICAL FIELD

The present invention relates to monitoring and controlling a pluralityof tanks in a multitank distributed fluid storage facility, inparticular of the type used for storing petroleum products.

BACKGROUND OF THE INVENTION

The great proliferation of the automobile in the last sixty years hasgiven rise to a corresponding proliferation of facilities for storingfuel for automobiles. The increasing use of long distance pipe linesfacilities for transporting petroleum products as well as the need fordistributing petroleum products in urban areas has led to theestablishment of fluid storage facilities commonly called tank farms. Insuch a facility a plurality of tanks are interconnected by a series ofpipes comprising a fluid conduit which in turn is interconnected as aterminal or distribution point from a long distance pipe line and isfurther interconnected with stations for transferring the storedproducts to over-the-road vehicles for local distribution.

In such facilities, particularly tank farms which terminate thereceiving end of long distance high volume pipe lines, it is necessaryto monitor and control the level of fluid in each tank as well as tomonitor other parameters of the tank including internal pressure andtemperature.

In modern petroleum facilities it is particularly important that thesystems for monitoring and controlling fluid flow and tank parameters bevery reliable since the failure to properly ascertain these quantitiescan lead to gasoline or other petroleum product overflows which are bothexpensive and dangerous. Several significant fires at petroleum tankfarms have occurred recently in this country under conditions whichbegan with an overflow of a particular tank which was not properlymonitoried and controlled.

Heretofore most monitoring of tank parameters, such as internalpressure, temperature of the fluid and fluid level have been monitoredby field interface devices (FID)s which include a float actuated levelindicator and a resistance temperature device (RTD) for ascertainingfluid level and temperature.

Prior art systems have transmitted analog signals from multiturnpotentiometers and analog signals from the RTDs over relatively longcable runs back to a central monitoring location. Due to the resistivelosses in the long cable runs and the dependence of these losses uponthe length of line from the particular tank to the central location,resolution of such prior art systems was relatively poor.

Furthermore, operation of electromechanical fluid control devicesassociated with the tanks such as motor operated valves, pumps and thelike was accomplished by human response to the monitoring outputswherein the human operator had to activate a separate set of controlsassociated with the fluid control devices in order to open or closevalves or operate pumps at a particular tank.

More recently float level indicators attached to mechanically drive ashaft connected to a shaft angle encoder have been used to monitor thelevel of fluid in a storage tank. One prior art system has used a pairof mark and space data lines running to each tank to transmit the outputof the shaft angle encoder back to a monitoring central location. Such asystem requires a dedicated pair of mark space data lines for each tankand furthermore requires that data decoding be accomplished at themonitoring location.

It has been found through experience in working with multitank fluidstorage facilities that it is often desirable to measure the temperatureof the fluid at differing levels in the tank depending upon the heightof the fluid stored within the tank. The prior art has accomplished sucha measurement by providing an array of RTDs vertically spaced within thetank, each of which may be connected, one at a time, to the circuitcarrying the temperature information back to a monitor. Prior artsystems have used float actuated trip switches which mechanically throwa set of switches to connect the appropriate RTD to the datatransmission line as the level of fluid in the tank changes. Such asystem has the drawback of the inherent lack of reliability associatedwith a mechanical device as well as the inability to select a workingRTD should the RTD selected by the float arrangement fail.

More recently remote storage tank gauging system have been introducedwhich include apparatus at each tank for performing an analog to digitalconversion of the output of an RTD and for transmitting the digitaloutput back to a monitoring location.

Heretofore the control and monitoring of the status of electromechanicalfluid control devices such as pumps and motor operated valves has beenactuated either locally at each tank or at certain sets of tanks withina larger tank farm or has been accomplished at separate control stationsat the remote location where the monitoring of tank parameters takesplace.

One of the reasons for the separation between the monitoring systems andthe fluid control device systems of prior art remote storage tankfacilities has been the difference in the power supply requirements forthese systems.

Conventionally the fluid control devices are operated through systemsincluding 24 volt or 48 volt relays and the power supplies associatedtherewith have been of too high a voltage or too unstable to deriveproper supply voltages for digital circuitry. Heretofore the prior arthas not provided a combined monitoring and control apparatus for use ina multitank fluid storage facility which at one control point bothintegrates the functions of monitoring tank parameters and controllingfluid control devices. Furthermore, prior to the present invention, ithas not been known to interface these devices without creating powersupply problems and also to provide immunity from environmentaltransients and noise, including lightning strikes near the storagefacility.

SUMMARY OF THE INVENTION

The present invention comprises an integrated remote storage tankgauging and control system which allows for monitoring of a plurality oftank parameters at a remote control location as well as operation ofelectromechanical fluid control devices at the tanks from the sameremote control location using the same input/output device and the samebidirectional communication link over which the tank parameter data issupplied.

The present invention comprises an intelligent field interface devicefor location at each tank in a multitank fluid storage facility whichmonitors the output of tank parameter transducers (such as temperature,pressure, and level), locally converts all analog transducer outputs todigital data and transmits same back to the control location.

Furthermore the field interface device of the present invention by anovel arrangment can both monitor and control the status ofelectromechanical fluid control devices over a two-wire circuit forcontrol of the devices which will be found on many tanks in existingfacilities.

All data transmitted from the FID and all commands received by the FIDare transmitted in a predetermined code, preferably United States ASCIIcode (ANSI X3.4-1968) thus allowing the entire tank facility to bemonitored and operated at the control location by a "dumb" terminal. Ofcourse it is possible to also provide computer intelligence at thecontrol location.

It is an object of the present invention to provide novel apparatusresident within the intelligent field interface device which may beeasily retrofitted to existing fluid control devices which will monitorthe status of these devices and control them over a conventionalpre-existing two-wire control circuit for such devices.

It is a further object of the present invention to provide apparatus ina field interface device which can electronically multiplex and averagethe temperature indication from a plurality of temperature transducersspaced vertically within a fluid storage tank and which can selectivelyignore the output of particular transducers which are out of range,indicating that the particular transducer has suffered a failure.

It is still a further object of the present invention to provide a fieldinterface device for use in a remote gauging and control facility forfluid storage tanks which is extremely insensitive to environmentalnoise and transients, including lightning strikes, and transients withinpre-existing field power supplies within a tank farm.

It is still a further object of the present invention to provideapparatus for use in a remote tank gauging and control facility whichinterconnects apparatus operating from conventional field power suppliesand apparatus controlled by well regulated power supply for the digitaland analog circuitry for the field interface device and, at the sametime, provides both electrical and magnetic isolation between the variuspower supplies so that transients on the order of thousands of voltsoccurring between the respective power supplies will not damage ordestroy the system.

These and other objects of the present invention will become apparentfrom a detailed description of the preferred embodiments below.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a tank farm including a control engagingsystem built around the intelligent field interface device of thepresent invention.

FIG. 2 is a block diagram of the field interface device of the presentinvention.

FIG. 3A is a schematic diagram of the power supply system of the presentinvention.

FIG. 3B defines the ground symbols for various grounds of the powersupplies shown throughout the the drawings.

FIG. 4 is a schematic diagram of the controller and the datacommunication link to the common communication bus of the preferredembodiment of the present invention.

FIG. 5 is a schematic diagram of the preferred embodiment of the controland monitoring circuit for fluid control devices of the presentinvention.

FIG. 6A is a schematic of a first preferred embodiment of a transducermultiplexing circuit of the present invention.

FIG. 6B is an alternate preferred embodiment for a transducermultiplexing circuit for the present invention.

DETAILED DESCRIPTION

The novel features of the present invention which fulfill the objectsset forth above will be appreciated by reference to the figures in whichlike numerals represent like elements.

Turning first to FIG. 1, a block diagram of the environment of thepresent invention may be seen. The present invention is designed for usein a multitank fluid storage facility comprising by example, three tanks15a--15c. As noted hereinabove, the specific use contemplated for thisinvention is in the environment of tanks for storing petroleum productsbut of course other fluids may be stored in tanks equipped with thepresent invention.

Each of tanks 15a--15c is interconnected by a conventional fluid conduitsystem 16 for replenishing and depleting the contents of each tank. Itis to be understood that the interface between each of tanks 15 andfluid conduit 16 will conventionally be equipped with electromechanicalfluid control devices (not shown) which may be electric pumps, motoroperated valves, or some combination thereof.

Each of tanks 15a-15c is equipped with one of intelligent FIGs 17a-17cof the present invention. It is to be understood that FID 17 will beconnected to conventional float level indicators (not shown),conventional temperature transducers such as RTDs (not shown), andconventional pressure transducers (not shown).

Each of FID 17 is connected to a common bidirectional communications bus20 which in turn is connected to apparatus at a control location 18. Asshown in FIG. 1, a single terminal 19, which may be a dumb terminal, canbe used with the preferred embodiment of the present invention for allmonitoring and control functions described herein.

It is also possible to connect communications bus 20 via a branch shownin phantom as 21 to a computer 22 which may be programmed to operate thefluid control devices of tanks 15 and to respond to the monitoring dataprovided by FID 17 on communications bus 20.

It is to be understood that the arrangement of the present inventionallows for all data and instructions on communications bus 20 to betransmitted serially in standard ASCII code. The present invention isfurther arranged so that communications bus 20 and the interfacesthereto may be constructed according to EIA standard RC422-A. Thepreferred embodiment of the present invention may also easily bearranged to provide a data communication bus 20 and interfaces theretowhich comply with EIA standard RS-232 or other full duplex or halfduplex arrangements.

It should be understood that each of FIDs 17 is addressable andtherefore the entire system may be interconnected via communications bus20 which may comprise a two-wire or four-wire circuit linking the entiresystem shown in FIG. 1.

Turning next to FIG. 2, a block diagram of the intelligent fieldinterface device (FID) of the present invention may be seen.Bidirectional communication bus 20 is shown as a full duplex busconnected through a surge protection network 25 to a full duplexdifferential line transceiver 26. As will become apparent from thedescription below, the embodiments of the present invention may beconstructed which are either full duplex or half duplex withoutdeparting from the scope of the invention.

Line transceiver 26 is connected to a universal asynchronousreceiver/transmitter (UART) 28. UART 28 controls the flow of databetween bidirectional communications bus 20 and internal data bus 30 ofthe FID.

Data bus 30 interconnects a controller 35 with a set of digital inputs31 and digital outputs 32.

Data bus 30 is also connected to an analog to digital converter 36 whichhas as its analog input, the output of an analog multiplexer 40.Multiplexer 40 has as its inputs a plurality of analog signals appearingon lines 37 which will be understood to carry the outputs of varioustransducers associated with one of the storage tanks.

Before proceeding to a detailed description of the FID, the surgeprotection and isolation arrangment of the power supplies used with thepreferred embodiment of the present invention will now be explained. Asnoted hereinabove, it is the novel isolation and surge protectionarrangment in the power supplies of the present invention which allowsthe interconnection of both monitoring and operating devices and the FIDand at the same time effectively isolates the system subcomponents fromeach other in a manner which greatly increases the total systemreliability.

Turning now to FIG. 3A, the preferred embodiment of the power supply forthe present invention may now be seen. It is to be understood that thepreferred embodiment of the present invention uses four basic types ofisolation and surge protection devices: gas filled tubes, transzorbs,optocouplers, and DC to DC converters.

In FIG. 3A, at the lefthand side thereof, it may be seen that an inputport 41 for accepting a conventional field supply input is provided. Itwill be appreciated by those skilled in the art that existing tank farmsare conventionally supplied with a DC supply in the field usually of 24or 48 volts. On the figures herein it is to be understood that anindication of a voltage supply followed by the notation "(F)" indicatesthat the source is on the field side of the power supply shown in FIG.3A.

The input from port 41 is regulated by a conventional integrated circuitthree terminal regulator 42 which provides a regulated input voltage toDC to DC converter 45 and further provides input to a secondconventional three terminal regulator 46 which provides the five voltfield supply for the embodiment shown.

FIG. 3B shows the notation used in the drawings to represent varioustypes of grounds within the system. As may be seen in FIG. 3B, threetypes of grounds are interconnected in the preferred embodiment: thecase ground which will conventionally be a truth earth ground and willbe the common point for the metal housings containing various componentsof the present invention and the tank farm; the supply common which isthe ground reference point for the supply shown in FIG. 3A on the inputside of converter 45; and the analog and digital ground which is theground reference for the analog and digital circuitry of the fieldinterface device of the present invention and is electrically andmagnetically isolated from the field supply by converter 45.

It will be appreciated by those skilled in the art that DC to DCconverter 45 is a conventionally available component which magneticallyisolates its input port comprising point 46 and the supply common andits output point at points 47 and 48.

A conventional integrated circuit negative regulator 49 on the outputside of converter 45 also supplies a negative five volt supply forcomponents of the FID which require same.

As may be seen, at input port 41 on the field supply side of the supplyshown in FIG. 3A, a gas filled tube 50 provides surge protection betweenboth sides of input port 41 and the case ground of the present system.It will be appreciated by those of ordinary skill in the art that suchgas filled tubes will conduct upon the occurrence of a condition of apredetermined voltage existing between any pair of terminals of thetube. As is known, the mechanism for conduction is the ionization of gaswithin the tube which causes current to flow once the voltage thresholdhas been reached. In the preferred embodiment ionization voltages on theorder of 150 volts are used in the gas filled tubes shown therein.

The input to regulator 42 is also protected by a transzorb 51. It willbe appreciated by those skilled in the art that transzorbs areconventionally available transient suppression devices which will absorbvery large power surges in the event of a voltage spike appearing acrossits terminals. For example, available transzorbs may absorb spikeshaving peak pulse powers on the order of fifty kilowatts and a durationof a microsecond. It should also be understood that such devices will"turn on" within approximately one nanosecond of the application of thespike between its terminals.

It has been found in testing of embodiment of the present invention thatthe combination of gas tubes such as tube 50 and transzorbs such asdevice 51 will protect the preferred embodiment of the present inventionunder extreme environmental conditions designed to approximate alightning strike near a tank.

Turning now to FIG. 4, a schematic diagram of a portion of the preferredembodiment of the field interface device of the present invention may beseen. The various bus structure shown on FIG. 4 include numericalindications in parenthesis of the number of lines at each portionthereof.

In relating the elements shown on FIG. 4 to the block diagram of FIG. 2,it should be noted that UART 28 is embodied by a type IM6402 currentlymanufactured by Intersil Inc. of Cupertino, California. The preferredembodiment of the controller 35 of the present invention is shown onFIG. 4 as a type 8748 one chip microcomputer currently manufactured byIntel Corporation of Santa Clara, Calfifornia. As will be appreciated bythose skilled in the art, the type 8748 is a one chip eight bitmicrocomputer having a 1K×8 bit erasable programmable read only memoryresident therein. The microcomputer also includes a sixty-four wordrandom access memory on the chip. Data bus 30 is connected to the databus port, pins DB0-DB7 of controller 35. The type 8748 also includes apair of eight bit quasi bidirectional ports designated as P10-P17 andP20-P27.

In the preferred embodiment of the present invention, the first quasibidirectional port is connected to a bus designated 52, the basicfunction of which is to control traffic on data bus 30 and to controlcommunication between UART 28 and bidirectional communication bus 20.

The second quasi bidirectional port, P20-P27, is connected to an eightbit bus 55, the basic function of which is to control the analog todigital conversion processes described in detail hereinbelow.

In a tank gauging and control system using a plurality of fieldinterface devices constructed according to the preferred embodiment ofthe present invention, each field interface device characterized by aneight bit address defined by address selector 56. It will be appreciatedthat address selector 56 may be a combination of jumpers and pull upresistors, switches or any other conventional means which may be set inthe field to define an eight bit word which will appear on eight linesdesignated as 57. It will further be appreciated that for each addressappearing on bidirectional communication bus 20 which is received byUART 28 and eventually loaded from data but 30 into controller 35, thatthe software of the controller will test that address against theaddress defined by address selector 56 to determine if particularinstructions are intended for that particular FID.

Also shown in FIG. 4 as block 58 is a conventional fluid level detectorarrangement which will be understood to be a float positioned somewherewithin the tank associated with the particular FID shown in FIG. 4. Thisfloat will mechanically drive a rod connected to a geared arrangementfor driving a shaft. The output of the shaft is connected to a shaftangle encoder 59 which will be understood to provide a sixteen bit graycode output indicative of the level of liquid in the tank. Combinationof fluid level detector 58 and shaft angle encoder 59 is known in theart and these components are available as off-the-shelf items.

The outputs of address selector 56 and shaft angle encoder 59 areconnected to data bus 30 through sets of three state buffers 61 and 62,respectively. As may be seen from the drawing, two lines each from bus52 control whether sets of three state buffers 61 and 62 are in theirhigh impedance state or connect the respective inputs from the sets ofbuffers to data bus 30. It will be apparent that controller 35 isprogrammed so that only eight bits at a time are connected to bus 30with the remaining outputs connected to the bus being placed in a highimpedence state.

Three state buffers 61 also connect the three error indication bitsshown as three bit bus 69 from UART 28 as well as line 68 to data bus30. The function of line 68 will be explained in detail hereinbelow inconnection with FIG. 5.

The three remaining bits from bus 52 control the CRL, the negated TBRL,and the RRD inputs to UART 28. The symbols for these inputs on UART 28are in conformance with thos promulgated by Intersil Inc., themanufacturer of the type IM6402 UART. It will be appreciated that theabove recited inputs control loading of the transmit, receive, andcontrol registers within the UART. The control register for UART 28comprises five input bits shown as a five bit tap 70 to data bus 30 toan input labeled control word on UART 28.

Two eight bit buffered ports 71 and 72 are the transmit buffer andreceive buffer for UART 28 and both are connected to data bus 30.

Two other direct connections between UART 28 and controller 35 areprovided along lines 75 and 76. Line 75 connects the transmit registerempty (TRE) output of UART 28 to one of the testable inputs (T1) of the8748 controller and the negated form of the data received (OR) output ofUART 28 (indicating that a complete received word has been read into thereceive buffer) is connected to the negated interrupt (INT) input ofcontroller 35. It will thus be apparent that controller 35 will have itsroutine interrupted upon an indication from UART 28 that a complete wordhas been received from bidirectional communication bus 20 andfurthermore that the control program for controller 35 can periodicallytest line 75 to ascertain whether the last word loaded into the transmitbuffer has been transmitted.

The block noted as optical isolation element 27 on FIG. 2 manifestsitself as three optocouplers 27a-27c on the preferred embodiment shownin FIG. 4. Optocouplers 27 serve to isolate the "side" of the FIDconnected to the analog and digital power supply from the side of theFID connected to the field supplies. In this case the digital circuitryon FIG. 4 described hereinabove is connected to the magneticallyisolated analog and digital supply which is shown as the extremerighthand end of FIG. 3A and the bidirectional communication bus 20 issupplied by the five volt field supply.

Note that on each of optocouplers 27 one element of the coupler isconnected to a field supply and the supply common ground while the otherelement of the coupler is connected to the analog and digital supply andthe analog and digital ground. One line 77 from control bus 55 drivesoptocoupler 27c. When line 77 is high, point 78 will go high turning ontransistor 79 which grounds point 80. This condition is establishedwhenever controller 35 determines that the particular FID shown in FIG.4 is going to transmit a word from UART 28 onto bidirectionalcommunication bus 20. The grounding of point 80 disables the receiveramplifier 81 of differential line transceiver 26. As is indicated onFIG. 4, the preferred embodiment of differential line transceiver 26 isa type SN75116 integrated circuit differential line transceivercurrently manufactured by Texas Instruments Inc. of Dallas Texas. Notealso that when point 78 goes hight the DE input to transceiver 26 goeshigh which enables the transmit amplifier of the transceiver.

As shown in FIG. 4, the preferred embodiment of bidirectionalcommunication bus 20 includes a pair of differential lines fortransmission (TO, negated TO) and a receive differential pair (RD,negated RD). It will thus be appreciated that the preferred embodimentof bidirectional communication bus 20 is full duplex. As indicatedhereinabove it is preferred to arrange bidirectional communication bus20 according to EIA revised standard 422-A. However it should be notedthat provision is made for a pair of jumpers 82 which will tie therespective differential pairs together thus establishing a half duplexsystem on communication bus 20.

The output of receive amplifier 81 is connected via line 85 to thephotodiode of optocoupler 27a, the output of which is connected alongline 86 to the receive register input (RRI) of UART 28. The serialoutput of UART 28 appears at the transmit register output (TRO) of theUART and is connected by line 87 to transistor 88 which controls thephotodiode of optocoupler 27b. The output of optocoupler 27b isconnected via line 89 to the transmit amplifier 90 of transceiver 26.

It will thus be appreciated that optocouplers 27a-27c provide completeoptical isolation between the controller 35 and UART 28 of the FID onone side and bidirectional communication bus 20 on the other side. Notethat the differential pairs of bus 20 are surge protected by transzorbs91a-91f connected to the supply common ground, and protected againstsurges of differential voltage across each pair and between the caseground by gas tubes 92a and 92b.

As described hereinabove the preferred embodiment of the presentinvention performs an analog to digital conversion of the outputs ofvarious transducers which measure various parameters of each tanklocally at the FID. This function is performed in the preferredembodiment by A to D converter 26 which is preferably a type ICL7109twelve but dual slope integrating analog to digital converter currentlymanufactured by Intersil Inc. of Cupertino, California. The output of Ato D converter 36 appears on an eight bit bus 95 which is directlyconnected to data bus 30. It will be understood that four bit controlbus 96 controls the conversion cycle of converter 36 as well as controlof the multiplexing of the twelve bit output of the converter onto eightbit bus 95.

From FIG. 4 it may be appreciated that all eight bits of the secondquasi bidirectional port (P20-P27) of controller 35 are dedicated tocontrol of the analog to digital converter 36 with the exception oflines 65 and 77. A to D converter 36 includes a reference voltage inputwhich appears on line 97 and an analog input pair comprising lines 98and 99.

It is to be appreciated that any notation on FIG. 4 indicating that aline goes to FIG. 6 or is received from FIG. 6 should be understood tobe connected to either of the embodiments of the analog multiplexing andtransducer arrangements shown in FIGS. 6A and 6B. It is therefore to beunderstood that the embodiments shown in FIGS. 6A and 6B aresubstitutional in nature.

From the foregoing it should be appreciated that controller 35 controlsthrough data bus 30 and control buses 52 and 55 all communication withinthe preferred embodiment of the field interface device as well ascommunication with bidirectional communication bus 20 which takes placethrough UART 28. It will further be appreciated that each FIDconstructed according to FIG. 4 will have a unique and predeterminedaddress determined by address selector 56 and that the state of the bitsestablished on bus 57 by selector 56 will always be compared to anincoming address word from UART 28 to ascertain if a particularinstruction is intended for the particular FID.

It will further be appreciated that the local conversion of the analogoutput of tank parameter transducers provides an accuracy that is onlylimited by the accuracy of the transducer itself and any environmentalconditions local to the tank. By performing local analog to digitalconversion the accuracy of the reading of each transducer is not afunction of the distance that the particular transducer is from controllocation 18 (FIG. 1).

It should further be appreciated that controller 35 is programmed toconvert all data being transmitted to UART 28 onto bidirectionalcommunications bus 20 into United States ASCII code.

It should further be appreciated that controller 35 is programmed totreat each output word from the receive buffer of UART 28 as onecharacter of ASCII code and therefore all communications between thepreferred embodiment of the FID shown in FIG. 4 and control location 18shown in FIG. 1 may be accomplished via a dumb terminal at the controllocation.

This arrangement leads not only to a simple scheme of communicating butalso to a large measure of interchangeability of terminal equipmentcommunicating with each FID. It should further be appreciated that alarge variety of computers may be used at control location 18 (FIG. 1)so long as their output is programmed to generate ASCII code charactersand is attached to an appropriate serial interface for connection withbidirectional communication bus 20.

Turning next to FIG. 5, the novel arrangement for monitoring andcontrolling electromechanical fluid control devices of the presentinvention may be seen in its preferred embodiment. As shown in FIG. 5,by way of example, a motor operated valve 110 is one such fluid controldevice which will be present on an existing fluid storage tank to whichthe preferred embodiment of the present invention is to be connected. Itshould also be appreciated that a pump or any other device used tocontrol the flow of the stored liquid into or out of the tank may beused in connection with the apparatus shown on FIG. 5 without departingfrom the scope of the present invention.

A dashed line, the ends of which are denoted as 111a and 111b shown onFIG. 5 indicates the interface between conventional preexisting devicesto be monitored and controlled (on the right side of FIG. 5) and thepreferred embodiment of the present invention.

In the example of motor operated valve 110 shown in FIG. 5, a terminal112 labeled "motor supply" represents any existing supply of electricalcurrent to operate valve 110 in one of its two possible operationaldirections. Conventionally the motor associated with valve 110 will be adirect current motor which is reversible by changing the polarity at itsinput terminals.

Conventionally motor operated valve 110 will be controlled by a pair ofrelays 115 and 116. It is to be understood that closure of relay 115which is activated when a sufficient pull-in current is provided throughcoil 117 will cause motor operated valve 110 to move toward its openposition. Likewise sufficient pull-in current through coil 118 of relay116 will cause motor operated valve 110 to move toward its closedposition.

It is to be understood that a pair of normally closed limit switches 119and 120 are in series with coils 117 and 118, respectively, andterminate current to these coils when valve 110 reaches either one ofits extreme positions. In FIG. 5, limit switch 119 opens when valve 110reaches its fully open position and limit switch 120 opens when thevalve reaches its fully closed position. It is to be understood thatlimit switches 119 and 120 are mechanically connected to moving parts ofvalve 110 by an arrangement which is not shown and is conventional innature.

A dashed line 121 indicates a mechanical connection between motoroperated valve 110 and the wiper 122 of potentiometer 125. It is to beunderstood that potentiometer 125 is a conventional position indicatingpotentiometer which serves as a voltage divider to establish a voltageon line 126 which is indicative of the position of the valve. Line 126is connected through a resistor 127 which is shunted to analog anddigital ground via a transzorb 128 to line 129, the function of whichwill be explained herein in connection with FIG. 6A.

As was noted hereinabove, prior art systems have monitored the voltagefrom wiper 122 of valve position potentiometers similar to potentiometer125 via analog connections back to a control location. The inventorsbelieve that heretofore no field interface device designed formonitoring tank parameters has also included an arrangement which can,over the same communication bus, control devices such as motor operatedvalve 110 as well as ascertain the state of limit switches 119 and 120.

Note that as a conventional arrangement the ground side of each of coils117 and 118 are tied to point 130. Point 130 is connected through a highpower small value resistor 131 whose primary function is to dissipatepower in the event of a large surge in the system to point 132.

Point 132 is connected to ground via a voltage divider comprisingresistors 135 and 136, each of which, in the preferred embodiment, is ofequal value and on the order of approximately 4.7 kilohms. Note thatresistor 136 is shunted by the photodiode 157 of an optocoupler 137.

Point 132 may alternately be connected to ground through thephototransistor 139 of optocoupler 138.

It will thus be appreciated that point 132 comprises the gounding pointfor each of relay coilds 117 and 118. It should further be noted thatpoints 141 and 142, are, respectively, the input points at which thecontrol voltage for operating coils 117 and 118 are to be applied. Itwill thus be appreciated that points 141 and 132 comprise a portion of atwo-wire circuit for operating relay coil 117 which comprises anoperating means for activating motor operated valve 110. It will furtherbe appreciated that said two-wire circuit includes limit switch 119 inseries therewith.

Similarly points 142 and 132 comprise a second two-wire circuit foroperating relay 116 which comprises an operating means for operatingvalve 110 in a particular direction and this two-wire circuit is also inseries with a limit switch, 120.

It should be understood that the combination of circuitry controllingoptocoupler 138 and resistors 135 and 136 provide a novel and simplemeans for establishing one of two impedance states controlling theimpedance between point 132 and ground. It will be appreciated by thoseskilled in the art that the dark resistance associated withphototransistor 139 of optocoupler 138 is on the order of severalmegohms and therefore when photodiode 140 is nonconducting, transistor139 may be considered removed from the circuit. It will further beappreciated that when photodiode 140 is driven fully that transistor 139will saturate thus effectively shunting resistors 135, 136 andoptocoupler 137, thereby providing a low impedance path to ground frompoint 132.

As may be seen in FIG. 5, a four bit tap 63 from data bus 30 ofcontroller 35 is provided as the input to a latch 145 which is clockedto latch inputs from tap 63 onto the outputs of latch 145 upon apositive transition on line 65. The four bit output of latch 145provided to a quad inverting buffer 146. The outputs of buffer 146 eachdrive the photodiode of one of four optocouplers 138, 147, 148, and 149.For each of these optocouplers the photodiode side is connected to theanalog and digital five volt supply and the phototransistor associatedwith each optocoupler is driven from the twenty-four volt field supply.It will therefore be appreciated that optocouplers 138 and 147-149provide optical isolation between the analog and the digital circuitryof the FID and the conventional preexisting circuitry shown to the rightof line 111a-111b.

The output of optocoupler 149 is provided to line 150 which in turn isprovided to a block 151 labeled "stop". It is to be understood that whenthe transistor of optocoupler 149 is turned on, block 151 represents aconventional emergency stop function associated with motor operatedvalve 110. In all other normal operations a logical one will be providedas the output of the particular inverting buffer connected to thecathode of the photodiode of coupler 149 and thus the stop function willnot be activated.

Optocoupler 138, as described hereinabove controls impedance betweenpoint 132 and ground. Optocouplers 147 and 148 drive points 141 and 142,respectively, and thus control relays 115 and 116, respectively.

Consider for a moment that the word in latch 145 causes photodiode 140of optocoupler 138 to conduct thus effectively grounding point 132. Alogical zero on one of lines 155 or 156 will activate the associated oneof optocoupler 147 and 148. Consider for example that it is desired tomove motor operated valve 110 toward its open position. Therefore alogical zeroes will be provided to lines 152 and 155 thus establishing acurrent path through point 141, coil 117 to point 130 and on to point132 and thus to ground through phototransistor 139. The low impedancepath to ground through transistor 139 allows sufficient current flowthrough this two-wire circuit to pull in relay 115 and thus operatemotor operated valve toward its open position.

It will similarly be appreciated that logical zeros on lines 156 and 152will supply sufficient current to coil 118 to operate relay 116 thusmoving motor operated valve 110 toward its closed position. It willtherefore be appreciated that optocouplers 138, 147 and 148 providesufficient isolation to prevent interaction between the twnety-four voltfield supply and the five volt analog and digital supply but still allowthe preferred embodiment of the present invention to operate a fluidcontrol device such as valve 110.

Next consider the situation in which a logical one is provided on line152 thus extinguishing photodiode 140 and a logical one is provided online 155. In these circumstances a current path is established from thetwenty-four volt field supply through point 141 and coil 117 to point130 and on to point 132. From there the current path travels throughresistor 135 and the parallel combination of resistor 136 and thephotodiode 157. Due to the presence of resistor 135 in this circuit thecurrent in this loop under the conditions described wil be on the orderof a few milliamps. Conventionally relays such as relays 115 and 116associated with valve 110 require currents about an order of magnitudegreater than this to pull in and thus while current will flow throughthe coils, the current will be insufficient to create the necessarymagnetic field to actuate these relays. It will be appreciated that thevalue of resistor 135 may be selected in order to assure that, withphotodiode 140 darkened, the current in the loop will be insufficient topull in the relay.

Note however that the current through the above described loop will besufficient to activate photodiode 157 and thus operate thephototransistor of coupler 137 pulling line 68 low. Note from FIG. 4that line 68 is provided to one bit of data bus 30 through three statebuffers 61 and thus the logical condition on this line may be read underthe control of controller 35. The activation of photodiode 157 under theconditions described indicates that limit switch 119 is closed becauseof the fact the current is flowing through the loop to activate diode157. If motor operated valve 110 were at its fully open position whenlogical zeros were present on lines 152 and 155, limit switch 119 wouldbe open and no current would flow through photodiode 157. Thereforeunder these conditions line 68 would be at a logical one stateindicating that limit switch 119 was open.

It will be apparent that the combination of a logical zero on line 152and a logical zero on line 156 provides an analogous scheme for testingthe state of limit switch 120 to ascertain if motor operated valve 110is fully closed.

From the foregoing it will be appreciated that each of the two-wirecircuits described hereinabove between points 141 and 132 and points 142and 132 are used both for operating relays 115 and 116 (whenphototransistor 139 is on) and for testing the state of limit switches119 and 120 without affecting relays 115 and 116 when phototransistor139 is off. It will therefore be appreciated that optocoupler 138provides a switching means which is selectively operable for providing afirst impedance state in one of the above described two-wire circuitswhen transistor 139 is on. In this state an operating voltage suppliedfrom one of optocouplers 147 and 148 will operate one of the relaysassociated with valve 110.

It will further be appreciated that when a second impedance state isprovided at point 132 by turning off transistor 139 that the applicationof the operating voltage at one of points 141 or 142 will not operateone of the relays but can be used through optocoupler 137 to test thestate of limit switches 119 and 120. It will thus be appreciated thatthe circuitry of FIG. 5 provides a novel and simple apparatus which maybe directly connected to existing fluid control devices and which,through the same two-wire circuit, may both operate a fluid controldevice and test the state of a limit switch in series with the deiviceover the same two wires.

FIGS. 6A and 6B show alternative embodiments of circuitry connected toanalog multiplexer 40 shown in FIG. 2. It is of course possible toselect other analog inputs to multiplexer 40 or to combine combinationsof those shown in FIGS. 6A and 6B. The apparatus shown in FIG. 6A and 6Bis a scheme for multiplexing various analog outputs from transducersconventionally associated with each fluid storage tank onto lines 98 and99 which are shown in FIG. 4 as the analog input to A to D converter 36.

In FIG. 6A, the first preferred embodiment is shown wherein three tankparameters are measured by three tank parameter transducers and theanalog outputs thereof are multiplexed onto lines 98 and 99.

The preferred embodiment of the present invention uses a type 4502 CMOSanalog multiplexer currently manufactured by several semiconductormanufacturers, including RCA. It will be appreciated that the 4052 is adifferential analog multiplexer which connects one of a pair of outputsOX,OY; 1X,1Y;--3X,3Y to outputs X,Y. The particular pair which isconnected to the XY output is selected by lines 66 and 67 shown in FIG.6A. As may be seen from FIG. 4, lines 66 and 67 are two lines from eightbit control bus 55 from the P20-P27 quasi bidirectional port ofcontroller 35. It will thus be appreciated that the particular analoginput from multiplexer 40 which is provided to the output on lines 98and 99 is under the control of controller 35.

In the first preferred embodiment of the tank parameter transducers asshown in FIG. 6A, conventional circuitry is provided to establish areference voltage on line 97. This is indicated on FIG. 6A as referencevoltage source 158. Also a conventional one milliamp current sourceshown as 159 is provided to drive a constant current through resistancetemperature device 160. Block 161 on FIG. 6A indicates that resistancetemperature device 160 and pressure transducer 162 are located withinthe particular tank with which the preferred embodiment of the FID isassociated. The voltage drop across RTD 160 appears between lines 165and 166 is inverted and amplified by an operational amplifier 167, theoutput of which appears at point 168. Resistors 169 and 170 form avoltge divider which divides the difference between the referencevoltage on line 97 and the voltage at point 168 and provides thisvoltage as an input at point 171 to a second operational amplifier 172.The output of amplifier 172 appears at point 175. The voltage differencebetween point 175 and ground comprises the zero XY pair on the inputs tomultiplexer 40.

The one input pair to multiplexer 40 is provided as a voltage differencebetween the analog and digital ground and line 129. Referring to FIG. 5it may be seen that line 129 carries the voltage on the wiper 122 ofposition potentiometer 125 associated with motor operated valve 110. Itwill therefore be appreciated that the analog input to the one XY pairprovides an indication of the position of motor operated valve 110 whichmay then be provided along lines 98 and 99 to A to D converter 36 to beconverted to a digital word to be transmitted back to the controllocation indicative of the valve position.

Also pressure transducer 162 within the tank as defined by block 161provides the two input to analog multiplexer 40. It will thus beappreciated that a variety of analog signals indicative of the value oftank parameters are continuously multiplexed on lines 98 and 99 wherethese analog voltages are converted to digital voltages by A to Dconverter 36 (FIG. 4) to eventually be transmitted onto bidirectionalcommunication bus 20 back to control location 18 (FIG. 1).

An alternate embodiment of multiplexer of analog signals to A to Dconverter 36 is shown in FIG. 6B. It is to be understood that alldevices referenced with the same numerals on FIGS. 6A and 6B areidentical and analogous. As may be seen from inspection of FIG. 6B, thisembodiment differs from the embodiment of FIG. 6A in two main respects.The first is that the embodiment of FIG. 6B shows a tank 161 with aplurality, in this case four, resistance temperature devices spacedvertically within the tank. The second difference is that the amplifyingarrangement comprising amplifiers 167 and 172 for providing an analogvoltage at point 175 indicative of the output of a particular resistancetemperature device is connected to the output of multiplexer 40 ratherthan to one of the inputs.

As described hereinabove, some preexisting tank facilities include aplurality of resistance temperature devices such as RTDs 176-179 spacedvertically within the tank so that temperature readings may be obtainedfrom a particular portion of the fluid in the tank when the fluid is atvarious levels. As also noted hereinabove, prior art tank monitoringfacilities included mechanical trip switches which were activated by afloat in order to select the RTD being read.

The alternate preferred embodiment of FIG. 6B shows a novel and morereliable scheme for taking advantage of the plurality of verticallyspaced RTDs 176-179.

In particular, through the address selected on a select lines 66 and 67,any particular one of RTDs 176-179 may be read under the control ofcontroller 35.

Furthermore it allows controller 35, in response to commands from thecontrol location transmitted over bus 20 to provide an average readingof the temperature indications from the respective RTDs 176-179.

Note again that a conventional constant current source 159 drives apredetermined current, preferably one milliamp, through all of RTDs176-179. Each of RTDs 176-179 has one two-wire pair 186-189,respectively, attached to cross its terminals and each of these pairs isprovided as one of the inputs to analog multiplexer 40. Under thecontrol of select lines 66 and 67 the output from one of pairs 186-189is provided on output pair 190 connected to the XY outputs ofmultiplexer 40. For each RTD, the output of which is connected to pair190, an analog voltage will be provided between lines 98 and 99indicative of the temperature at that particular vertical locationwithin the tank.

It is to be understood that controller 35 contains in memory anindication of the possible ranges for the output voltages generated inresponse to RTDs 176-179. Controller 135 is arranged to discard anyreading from one of RTDs 176-179 which is out of range and therefore amajor problem which arose in prior art systems of multiple RTDs spacedvertically in the tank is eliminated. This problem is one that arosewhen a particular one of the plurality of RTDs failed and the fluidlevel in the tank was such that the failed RTD is the one selected forreading. In prior art systems there was no way short of entering thetank to override this situation and it effectively left the controllocation blind to the temperature within that particular tank.

By using the arrangment of FIG. 6B, it is possible to either selectparticular ones of RTDs 176-179, to selectively ignore an out of rangereading, and to provide an average indication of the temperature basedon the various temperature occurring vertically within the tank.

It will be appreciated from the foregoing description of the preferredembodiment of the present invention that the present invention is notonly useful in petroleum products storage facilities but will find otheruses in different types of fluid storage systems. It will further beapparent that based on the foregoing description of the preferredembodiment, other embodiments of the present invention may beconstructed within the scope of the claims below.

We claim:
 1. In a fluid storage tank including an electrically operatedfluid control device including at least one operating means foractivating said device in a particular direction in response toapplication of an operating voltage to a two wire circuit through saidoperating means, said operating means being in series with a limitswitch for breaking continuity of said two wire circut in response tosaid device reaching a predetermined operational state, the improvementof a control and testing apparatus for both operating said device anddetermining the state of said limit switch through said two wire circuitcomprising:switching means selectively operable for providing a firstimpedance state in said two wire circuit wherein said operating meanswill activate said device in response to said application of saidoperating voltage when said limit switch is closed, and alternately forproviding a second impedance state in said two wire circuit wherein saidoperating means is inhibited from activating said device in response tosaid application of said operating voltage; and testing means responsiveto said switching means being in said second state and said applicationof said operating voltage for providing an output signal indicative ofsaid state of said limit switch.